import Vue from 'vue';
import {encrypt} from "@/common/crypto";

let prefix = 'code/';
const send_code = (params) => {
    return Vue.prototype.$u.get(prefix + 'send_code', params);
};
const send_forget_code = (params) => {
    return Vue.prototype.$u.post(prefix + 'find_pwd', params);
};

const reg = (params) => {
    return Vue.prototype.$u.get(prefix + 'reg', params);
};

export const login = (params) => {
    return Vue.prototype.$u.get(prefix + 'login', encrypt(params));
};

const captcha = (params) => {
    return Vue.prototype.$u.get(prefix + 'captcha', params);
};

export const bind_phone = (params) => {
    return Vue.prototype.$u.get(prefix + 'bind_phone', encrypt(params));
};


export default {
    send_code,
    send_forget_code,
    reg,
    captcha,
}
